var shiData=" { " +
"'福建省' : [{'id':'福州市','name':'福州市'},{'id':'厦门市','name':'厦门市'},{'id':'莆田市','name':'莆田市'},"+
	"{'id':'三明市','name':'三明市'},{'id':'泉州市','name':'泉州市'},{'id':'漳州市','name':'漳州市'},"+
	"{'id':'南平市','name':'南平市'},{'id':'龙岩市','name':'龙岩市'},{'id':'宁德市','name':'宁德市'} ]}"; 
var xianData=" { " +
"'福州市': [ " +
	"{'id':'鼓楼区','name':'鼓楼区'},{'id':'晋安区','name':'晋安区'},{'id':'台江区','name':'台江区'}," +
	"{'id':'仓山区','name':'仓山区'},{'id':'马尾区','name':'马尾区'},{'id':'福清市','name':'福清市'}," +
	"{'id':'长乐市','name':'长乐市'},{'id':'闽侯县','name':'闽侯县'},{'id':'连江县','name':'连江县'}," +
	"{'id':'永泰县','name':'永泰县'},{'id':'闽清县','name':'闽清县'},{'id':'罗源县','name':'罗源县'} ]," +
"'三明市': [ " +
	"{'id':'永安市','name':'永安市'},{'id':'梅列区','name':'梅列区'},{'id':'三元区','name':'三元区'}," +
	"{'id':'明溪县','name':'明溪县'},{'id':'清流县','name':'清流县'},{'id':'宁化县','name':'宁化县'}," +
	"{'id':'大田县','name':'大田县'},{'id':'沙县','name':'沙县'},{'id':'将乐县','name':'将乐县'}," +
	"{'id':'建宁县','name':'建宁县'},{'id':'泰宁县','name':'泰宁县'} ]," +
"'南平市': [ " +
	"{'id':'延平区','name':'延平区'},{'id':'邵武市','name':'邵武市'},{'id':'武夷山市','name':'武夷山市'}," +
	"{'id':'建瓯市','name':'建瓯市'},{'id':'建阳市','name':'建阳市'},{'id':'顺昌县','name':'顺昌县'}," +
	"{'id':'浦城县','name':'蒲城县'},{'id':'光泽县','name':'光泽县'},{'id':'松溪县','name':'松溪县'}," +
	"{'id':'政和县','name':'政和县'}]," +
"'莆田市': [ " +
	"{'id':'荔城区','name':'荔城区'},{'id':'城厢区','name':'城厢区'},{'id':'涵江区','name':'涵江区'}," +
	"{'id':'秀屿区','name':'秀屿区'},{'id':'仙游县','name':'仙游县'}]," +
"'厦门市': [ " +
	"{'id':'思明区','name':'思明区'},{'id':'湖里区','name':'湖里区'},{'id':'集美区','name':'集美区'}," +
	"{'id':'海沧区','name':'海沧区'},{'id':'同安区','name':'同安区'},{'id':'翔安区','name':'翔安区'}]," +
"'宁德市': [ " +
	"{'id':'蕉城区','name':'蕉城区'},{'id':'东侨新区','name':'东侨新区'},{'id':'福安市','name':'福安市'}," +
	"{'id':'福鼎市','name':'福鼎市'},{'id':'古田县','name':'古田县'},{'id':'屏南县','name':'屏南县'}," +
	"{'id':'寿宁县','name':'寿宁县'},{'id':'周宁县','name':'周宁县'},{'id':'柘荣县','name':'柘荣县'}]," +
"'龙岩市': [ " +
	"{'id':'新罗区','name':'新罗区'},{'id':'连城县','name':'连城县'},{'id':'长汀县','name':'长汀县'}," +
	"{'id':'上杭县','name':'上杭县'},{'id':'武平县','name':'武平县'},{'id':'永定县','name':'永定县'}," +
	"{'id':'漳平市','name':'漳平市'}]," +
"'泉州市': [ " +
	"{'id':'鲤城区','name':'鲤城区'},{'id':'丰泽区','name':'丰泽区'}," +
	"{'id':'洛江区','name':'洛江区'},{'id':'泉港区','name':'泉港区'}," +
	"{'id':'晋江市','name':'晋江市'},{'id':'石狮市','name':'石狮市'}," +
	"{'id':'南安市','name':'南安市'},{'id':'惠安县','name':'惠安县'}," +
	"{'id':'安溪县','name':'安溪县'},{'id':'永春县','name':'永春县'}," +
	"{'id':'金门县','name':'金门县'},{'id':'德化县','name':'德化县'} ]," +
"'漳州市': [ " +
	"{'id':'芗城区','name':'芗城区'},{'id':'龙文区','name':'龙文区'}," +
	"{'id':'龙海市','name':'龙海市'},{'id':'云霄县','name':'云霄县'}," +
	"{'id':'漳浦县','name':'漳浦县'},{'id':'诏安县','name':'诏安县'}," +
	"{'id':'长泰县','name':'长泰县'},{'id':'东山县','name':'东山县'}," +
	"{'id':'南靖县','name':'南靖县'},{'id':'平和县','name':'平和县'}," +
	"{'id':'华安县','name':'华安县'} ]" +
"}"; 

function selectSheng(){
	$("#city").empty();
	$("#county").empty();
	$("#city").append('<option value="">--市--</option>');
	$("#county").append('<option value="">--县--</option>');
	var province = $("#province").val();
	if (province=="")return;
	var json= eval("("+shiData+")");
	var citys = json[province];
	$(citys).each(function (i){
		var city=citys[i];
		str='<option value="'+city.id+'"  >'+city.name+' </option>';
		$("#city").append(str);
	});
}

function selectShi(){
	$("#county").empty();
	$("#county").append('<option value="" >--县--</option>');
	var city = $("#city").val();
	if (city=="")return;
	var json= eval("("+xianData+")");
	var countys = json[city];
	$(countys).each(function (i){
		var county=countys[i];
		str='<option value="'+county.id+'"  >'+county.name+' </option>';
		$("#county").append(str);	
	});
}

   
